﻿/*!	r_type_win32.h
	@brief	WIN32型定義
Copyright (c) 2009 Yuya Yamaguchi

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

#ifndef _R_BASICTYPE_WIN32_H_
#define _R_BASICTYPE_WIN32_H_

typedef	char				r_si8;			//!< singed int 8bit
typedef	short				r_si16;			//!< singed int 16bit
typedef	int					r_si32;			//!< singed int 32bit
typedef	unsigned char		r_ui8;			//!< unsinged int 8bit
typedef	unsigned short		r_ui16;			//!< unsinged int 16bit
typedef	unsigned int		r_ui32;			//!< unsinged int 32bit
typedef	float				r_f32;			//!< float 32bit
typedef	double				r_f64;			//!< float 64bit

typedef	long long			r_si64;			//!< singed int 64bit
typedef	unsigned long long	r_ui64;			//!< unsinged int 64bit

typedef	bool				r_bool;			//!< boolean
typedef	unsigned char		r_byte;			//!< byte
typedef	unsigned short		r_word;			//!< word
typedef	unsigned long		r_dword;		//!< double word
typedef	unsigned long long	r_qword;		//!< quad word

typedef size_t				r_size;			//!< size_t

typedef	r_ui64				r_time;			//!< time type

typedef char				r_mchar;
typedef wchar_t				r_wchar;

// 文字コード対応
/*!
_RST("文字列")とすることでunicodeでも比較的安心?<br>
さらにマクロスイッチで切り替え可能な文字列操作用に
１文字を扱うr_char,
文字列を扱うr_cstr
を拡張しました。
*/
#ifdef R_USE_WCHAR
// _RST()までに1度マクロをかませないと文字列連結出来ないので...
#define	_RSTENC(s)			L ## s
#define _RST(s)				_RSTENC(s)
typedef wchar_t				r_char;
#else // _UNICODE
#define _RST(s)				s
typedef char				r_char;
#endif // R_USE_WCHAR

#define	r_cstr				r_char*
#define	r_mstr				r_mchar*
#define	r_wstr				r_wchar*

#ifndef NULL
#define NULL				0
#endif

// f32最大値
#define R_F32_MAX				(1e37f)


#endif // _R_BASICTYPE_WIN32_H_
